#!/bin/bash

test -e centos-config \
    || git clone https://gitee.com/iprintf/linux-config centos-config
cd centos-config
git pull

test -e config && rm config -rf

mkdir config
cp bashrc centos.sh common.sh gitconfig inputrc \
        libs.sh node.pub tmux1.conf tmux2.conf config

cat > config/update << EOF
#!/bin/bash

url=http://192.168.88.88/centos-config

curl -o /config/centos.sh \$url/centos.sh
curl -o /config/common.sh \$url/common.sh
curl -o /config/libs.sh \$url/libs.sh

EOF
chmod +x  config/update

test -e ../centos.tar && rm ../centos.tar -f

tar -cf ../centos.tar config

